﻿class Solution {
    public int maxScore(String s) {
        int Max=0;
        for(int i=1;i<s.length();i++){
String left=s.substring(0,i);
String right=s.substring(i,s.length());
if(score(left,'0')+score(right,'1')>Max){
    Max=score(left,'0')+score(right,'1');
}
        }
        return Max;
    }
    public int score(String str,char c){
        int num=0;
        for(int i=0;i<str.length();i++){
if(str.charAt(i)==c)
num++;
        }
        return num;
    }
}